﻿namespace MyFirstCastle.Web.Models
{
    using System;
    using System.Collections;
    using Castle.ActiveRecord;
    using NHibernate.Criterion;
    //using NHibernate.Expression;  // Can't find this namespace anywhere in the NHibernate assembly.

    [ActiveRecord]
    public class Supplier: ActiveRecordBase 
    {
        [PrimaryKey]
        public int Id
        {
            get;
            set;
        }

        [Property]
        public string Name { get; set; }

        public static Supplier[] FindAll()
        {
            return (Supplier[]) FindAll(typeof(Supplier), new Order[] { Order.Asc("Name") });
        }
    }
}
